import requset from '@/utils/service.js'


export let qi = (current,pageSize) => {
    if(!current)current=1
    if(!pageSize)pageSize=10000
    return requset({
        url: '/order/findAllOrderbyLimit',
        method: 'GET',
        params: {
            current,
            pageSize
        }
    })
}

export let yuangong = (current,pageSize) => {
    if(!current) current=1
    if(!pageSize) pageSize=2000
    return requset({
        url: '/admin/findall',
        method: 'GET',
        params: {
            current,
            pageSize
        }
    })
}

export let rizhi = () => {
    return requset({
        url: '/admin/log',
        method: 'GET',
        params: {
            current: 1,
            pageSize: 10
        }
    })
}

export let bianji = (adminId,adminName,adminTel) => {
    return requset({
        url: '/admin/updatebyid',
        method: 'POST',
        data: {
        body:{
     adminId,
     adminName,
     adminTel
     }
        }
    })
}

export let del = (adminId) => {
    return requset({
        url: '/admin/deleteOne',
        method: 'GET',
        params: {
            adminId
        }
    })
}

export let add = (adminName,adminMail,adminPass,adminSex) => {
    return requset({
        url: '/admin/add',
        method: 'POST',
        data: {
            adminName,
            adminPass,
            adminMail,
            adminSex
        }
    })
}

export let timequery = (startTime,endTime) => {
    return requset({
        url: '/admin/findbytime',
        method: 'GET',
        params: {
            startTime,
            endTime,
            current: 1,
            pageSize: 10
        }
    })
}

export let mendian = () => {
    return requset({
        url: '/order/findAllmoney',
        method: 'GET',
        params: {
        }
    })
}

// ## GET 根据员工id查询订单

// GET /order/findbyadmin

export let findbyadmin = (adminId,current,pageSize) => {
    return requset({
        url: '/order/findbyadmin',
        method: 'GET',
        params: {
         adminId,
         current,
         pageSize
        }
    })
}

// ## GET 根据订单id查询订单及订单明细

// GET /order/findallbyid

export let findallbyid = (orderid) => {
    return requset({
        url: '/order/findallbyid',
        method: 'GET',
        params: {
            orderid
        }
    })
}